#if !defined(SM__SPRITE_H)
#define SM__SPRITE_H

#include "swagme.h"

// rjr: sprite image format should be something like animation frames from rigt to left and different facings from top to bottom
// jms: yeah, i would say that all the frames can go into one .png/.bmp which just gets 
// loaded into one SDL_Surface that this guy manages.  Then, blitting a frame is just 
// a matter of setting the source rectangle (SDL_Rect) properly.  Of course the surface
// must be properly colour-keyed too...
class Sprite {
  public:
    Sprite();
    Sprite(const char *file);
    ~Sprite();
    // sets the position, facing and animation state then draws, animSpeed and frameCounter will move out later
    int Draw(sm_direction f, int animSpeed, int frameCounter, SDL_Surface *dst, int x, int y);
    int Blit(SDL_Surface *dst, int x, int y);
    void stopAnimation();
    void setFacing(sm_direction f);
    sm_direction getFacing();
  private:
    bool Animate;
    sm_direction Facing;
    char *SpriteImageFile; // image file to load sprite surface from
    int frameCount;
    SDL_Surface *pSpriteSurface; // surface with all frames of the sprite
    SDL_Rect Frame; // rect for the current frame
};

#endif // SM__SPRITE_H
